﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace QLTT.Views
{
    /// <summary>
    /// Interaction logic for StudentInvokeView.xaml
    /// </summary>
    public partial class StudentInvokeView : UserControl
    {
        public StudentInvokeView()
        {
            InitializeComponent();
            //Print();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Print();
        }
        private void Print()
        {
            try
            {
                PrintDialog dialog = new PrintDialog();
                if (dialog.ShowDialog() == true)
                {
                    dialog.PrintVisual(studentInvoice, Properties.Resources.Base_DisplayName_InvoicePrint);
                    Lien2.IsExpanded = true;
                    dialog.PrintVisual(studentInvoice2, Properties.Resources.Base_DisplayName_InvoicePrint);
                }
            }
            catch { }
            finally
            {
                QLTT.ViewModels.StudentInvokeModelView iVM = (QLTT.ViewModels.StudentInvokeModelView)this.DataContext;
                iVM.Close();
            }
        }
    }
}
